Python | Creating a Pandas dataframe column based on a given condition

28

# importing pandas as pd
import pandas as pd
  
# Creating the dataframe
df = pd.DataFrame({'Date' : ['11/8/2011', '11/9/2011', '11/10/2011',
                                        '11/11/2011', '11/12/2011'],
                'Event' : ['Music', 'Poetry', 'Music', 'Music', 'Poetry']})
  
# Print the dataframe
print(df)

Comments

Submit
0 Comments